package com.alex.dao;

import com.alex.pojo.Employee;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;

@Repository
public class EmployeeDao {

    @Value("mysql")
    private String dbname;

    @Value("123")
    private int count;

    private Map<String, Employee> employees = null;

    {
        employees = new HashMap<>();
        employees.put("1001", new Employee(1001, "alex", 12));
        employees.put("1002", new Employee(1002, "tom", 11));
        employees.put("1003", new Employee(1003, "lucy", 13));
    }

    public Employee getById(String id) {
        return employees.get(id);
    }

    public void showCount() {
        System.out.println(count);
    }
}
